<!DOCTYPE html>਍㰀䠀吀䴀䰀㸀ഀ
<HEAD>਍ऀ㰀吀䤀吀䰀䔀㸀 娀吀刀䔀䔀 䐀䔀䴀伀 ⴀ 爀攀䄀猀礀渀挀䌀栀椀氀搀一漀搀攀猀㰀⼀吀䤀吀䰀䔀㸀ഀ
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">਍ऀ㰀氀椀渀欀 爀攀氀㴀∀猀琀礀氀攀猀栀攀攀琀∀ 栀爀攀昀㴀∀⸀⸀⼀⸀⸀⼀⸀⸀⼀挀猀猀⼀搀攀洀漀⸀挀猀猀∀ 琀礀瀀攀㴀∀琀攀砀琀⼀挀猀猀∀㸀ഀ
	<link rel="stylesheet" href="../../../css/zTreeStyle/zTreeStyle.css" type="text/css">਍ऀ㰀猀挀爀椀瀀琀 琀礀瀀攀㴀∀琀攀砀琀⼀樀愀瘀愀猀挀爀椀瀀琀∀ 猀爀挀㴀∀⸀⸀⼀⸀⸀⼀⸀⸀⼀樀猀⼀樀焀甀攀爀礀ⴀ㄀⸀㐀⸀㐀⸀洀椀渀⸀樀猀∀㸀㰀⼀猀挀爀椀瀀琀㸀ഀ
	<script type="text/javascript" src="../../../js/jquery.ztree.core-3.5.js"></script>਍ऀ㰀℀ⴀⴀ  㰀猀挀爀椀瀀琀 琀礀瀀攀㴀∀琀攀砀琀⼀樀愀瘀愀猀挀爀椀瀀琀∀ 猀爀挀㴀∀⸀⸀⼀⸀⸀⼀⸀⸀⼀樀猀⼀樀焀甀攀爀礀⸀稀琀爀攀攀⸀攀砀挀栀攀挀欀ⴀ㌀⸀㔀⸀樀猀∀㸀㰀⼀猀挀爀椀瀀琀㸀ഀ
	  <script type="text/javascript" src="../../../js/jquery.ztree.exedit-3.5.js"></script>-->਍ऀ㰀匀䌀刀䤀倀吀 琀礀瀀攀㴀∀琀攀砀琀⼀樀愀瘀愀猀挀爀椀瀀琀∀㸀ഀ
		<!--਍ऀऀ瘀愀爀 猀攀琀琀椀渀最 㴀 笀ഀ
			view: {਍ऀऀऀऀ猀攀氀攀挀琀攀搀䴀甀氀琀椀㨀 昀愀氀猀攀ഀ
			},਍ऀऀऀ愀猀礀渀挀㨀 笀ഀ
				enable: true,਍ऀऀऀऀ甀爀氀㨀∀⸀⸀⼀愀猀礀渀挀䐀愀琀愀⼀最攀琀一漀搀攀猀⸀瀀栀瀀∀Ⰰഀ
				autoParam:["id", "name=n", "level=lv"],਍ऀऀऀऀ漀琀栀攀爀倀愀爀愀洀㨀笀∀漀琀栀攀爀倀愀爀愀洀∀㨀∀稀吀爀攀攀䄀猀礀渀挀吀攀猀琀∀紀Ⰰഀ
				dataFilter: filter਍ऀऀऀ紀Ⰰഀ
			callback: {਍ऀऀऀऀ戀攀昀漀爀攀䌀氀椀挀欀㨀 戀攀昀漀爀攀䌀氀椀挀欀Ⰰഀ
				beforeAsync: beforeAsync,਍ऀऀऀऀ漀渀䄀猀礀渀挀䔀爀爀漀爀㨀 漀渀䄀猀礀渀挀䔀爀爀漀爀Ⰰഀ
				onAsyncSuccess: onAsyncSuccess਍ऀऀऀ紀ഀ
		};਍ഀ
		function filter(treeId, parentNode, childNodes) {਍ऀऀऀ椀昀 ⠀℀挀栀椀氀搀一漀搀攀猀⤀ 爀攀琀甀爀渀 渀甀氀氀㬀ഀ
			for (var i=0, l=childNodes.length; i<l; i++) {਍ऀऀऀऀ挀栀椀氀搀一漀搀攀猀嬀椀崀⸀渀愀洀攀 㴀 挀栀椀氀搀一漀搀攀猀嬀椀崀⸀渀愀洀攀⸀爀攀瀀氀愀挀攀⠀⼀尀⸀渀⼀最Ⰰ ✀⸀✀⤀㬀ഀ
			}਍ऀऀऀ爀攀琀甀爀渀 挀栀椀氀搀一漀搀攀猀㬀ഀ
		}਍ऀऀ昀甀渀挀琀椀漀渀 戀攀昀漀爀攀䌀氀椀挀欀⠀琀爀攀攀䤀搀Ⰰ 琀爀攀攀一漀搀攀⤀ 笀ഀ
			if (!treeNode.isParent) {਍ऀऀऀऀ愀氀攀爀琀⠀∀ঋ㙢色릂≰⤀㬀ഀ
				return false;਍ऀऀऀ紀 攀氀猀攀 笀ഀ
				return true;਍ऀऀऀ紀ഀ
		}਍ऀऀ瘀愀爀 氀漀最Ⰰ 挀氀愀猀猀一愀洀攀 㴀 ∀搀愀爀欀∀㬀ഀ
		function beforeAsync(treeId, treeNode) {਍ऀऀऀ挀氀愀猀猀一愀洀攀 㴀 ⠀挀氀愀猀猀一愀洀攀 㴀㴀㴀 ∀搀愀爀欀∀ 㼀 ∀∀㨀∀搀愀爀欀∀⤀㬀ഀ
			showLog("[ "+getTime()+" beforeAsync ]&nbsp;&nbsp;&nbsp;&nbsp;" + ((!!treeNode && !!treeNode.name) ? treeNode.name : "root") );਍ऀऀऀ爀攀琀甀爀渀 琀爀甀攀㬀ഀ
		}਍ऀऀ昀甀渀挀琀椀漀渀 漀渀䄀猀礀渀挀䔀爀爀漀爀⠀攀瘀攀渀琀Ⰰ 琀爀攀攀䤀搀Ⰰ 琀爀攀攀一漀搀攀Ⰰ 堀䴀䰀䠀琀琀瀀刀攀焀甀攀猀琀Ⰰ 琀攀砀琀匀琀愀琀甀猀Ⰰ 攀爀爀漀爀吀栀爀漀眀渀⤀ 笀ഀ
			showLog("[ "+getTime()+" onAsyncError ]&nbsp;&nbsp;&nbsp;&nbsp;" + ((!!treeNode && !!treeNode.name) ? treeNode.name : "root") );਍ऀऀ紀ഀ
		function onAsyncSuccess(event, treeId, treeNode, msg) {਍ऀऀऀ猀栀漀眀䰀漀最⠀∀嬀 ∀⬀最攀琀吀椀洀攀⠀⤀⬀∀ 漀渀䄀猀礀渀挀匀甀挀挀攀猀猀 崀☀渀戀猀瀀㬀☀渀戀猀瀀㬀☀渀戀猀瀀㬀☀渀戀猀瀀㬀∀ ⬀ ⠀⠀℀℀琀爀攀攀一漀搀攀 ☀☀ ℀℀琀爀攀攀一漀搀攀⸀渀愀洀攀⤀ 㼀 琀爀攀攀一漀搀攀⸀渀愀洀攀 㨀 ∀爀漀漀琀∀⤀ ⤀㬀ഀ
		}਍ऀऀഀ
		function showLog(str) {਍ऀऀऀ椀昀 ⠀℀氀漀最⤀ 氀漀最 㴀 ␀⠀∀⌀氀漀最∀⤀㬀ഀ
			log.append("<li class='"+className+"'>"+str+"</li>");਍ऀऀऀ椀昀⠀氀漀最⸀挀栀椀氀搀爀攀渀⠀∀氀椀∀⤀⸀氀攀渀最琀栀 㸀 㠀⤀ 笀ഀ
				log.get(0).removeChild(log.children("li")[0]);਍ऀऀऀ紀ഀ
		}਍ऀऀ昀甀渀挀琀椀漀渀 最攀琀吀椀洀攀⠀⤀ 笀ഀ
			var now= new Date(),਍ऀऀऀ栀㴀渀漀眀⸀最攀琀䠀漀甀爀猀⠀⤀Ⰰഀ
			m=now.getMinutes(),਍ऀऀऀ猀㴀渀漀眀⸀最攀琀匀攀挀漀渀搀猀⠀⤀Ⰰഀ
			ms=now.getMilliseconds();਍ऀऀऀ爀攀琀甀爀渀 ⠀栀⬀∀㨀∀⬀洀⬀∀㨀∀⬀猀⬀ ∀ ∀ ⬀洀猀⤀㬀ഀ
		}਍ഀ
		function refreshNode(e) {਍ऀऀऀ瘀愀爀 稀吀爀攀攀 㴀 ␀⸀昀渀⸀稀吀爀攀攀⸀最攀琀娀吀爀攀攀伀戀樀⠀∀琀爀攀攀䐀攀洀漀∀⤀Ⰰഀ
			type = e.data.type,਍ऀऀऀ猀椀氀攀渀琀 㴀 攀⸀搀愀琀愀⸀猀椀氀攀渀琀Ⰰഀ
			nodes = zTree.getSelectedNodes();਍ऀऀऀ椀昀 ⠀渀漀搀攀猀⸀氀攀渀最琀栀 㴀㴀 　⤀ 笀ഀ
				alert("请先选择一个父节点");਍ऀऀऀ紀ഀ
			for (var i=0, l=nodes.length; i<l; i++) {਍ऀऀऀऀ稀吀爀攀攀⸀爀攀䄀猀礀渀挀䌀栀椀氀搀一漀搀攀猀⠀渀漀搀攀猀嬀椀崀Ⰰ 琀礀瀀攀Ⰰ 猀椀氀攀渀琀⤀㬀ഀ
				if (!silent) zTree.selectNode(nodes[i]);਍ऀऀऀ紀ഀ
		}਍ഀ
		$(document).ready(function(){਍ऀऀऀ␀⸀昀渀⸀稀吀爀攀攀⸀椀渀椀琀⠀␀⠀∀⌀琀爀攀攀䐀攀洀漀∀⤀Ⰰ 猀攀琀琀椀渀最⤀㬀ഀ
			$("#refreshNode").bind("click", {type:"refresh", silent:false}, refreshNode);਍ऀऀऀ␀⠀∀⌀爀攀昀爀攀猀栀一漀搀攀匀椀氀攀渀琀∀⤀⸀戀椀渀搀⠀∀挀氀椀挀欀∀Ⰰ 笀琀礀瀀攀㨀∀爀攀昀爀攀猀栀∀Ⰰ 猀椀氀攀渀琀㨀琀爀甀攀紀Ⰰ 爀攀昀爀攀猀栀一漀搀攀⤀㬀ഀ
			$("#addNode").bind("click", {type:"add", silent:false}, refreshNode);਍ऀऀऀ␀⠀∀⌀愀搀搀一漀搀攀匀椀氀攀渀琀∀⤀⸀戀椀渀搀⠀∀挀氀椀挀欀∀Ⰰ 笀琀礀瀀攀㨀∀愀搀搀∀Ⰰ 猀椀氀攀渀琀㨀琀爀甀攀紀Ⰰ 爀攀昀爀攀猀栀一漀搀攀⤀㬀ഀ
		});਍ऀऀ⼀⼀ⴀⴀ㸀ഀ
	</SCRIPT>਍ഀ
</HEAD>਍ഀ
<BODY>਍㰀栀㄀㸀⠀⁵稀吀爀攀攀 뤀핥ɬ敟ꁫ絒芏릂灰湥㱣⼀栀㄀㸀ഀ
<h6>[ 文件路径: core/async_fun.html ]</h6>਍㰀搀椀瘀 挀氀愀猀猀㴀∀挀漀渀琀攀渀琀开眀爀愀瀀∀㸀ഀ
	<div class="zTreeDemoBackground left">਍ऀऀ㰀甀氀 椀搀㴀∀琀爀攀攀䐀攀洀漀∀ 挀氀愀猀猀㴀∀稀琀爀攀攀∀㸀㰀⼀甀氀㸀ഀ
	</div>਍ऀ㰀搀椀瘀 挀氀愀猀猀㴀∀爀椀最栀琀∀㸀ഀ
		<ul class="info">਍ऀऀऀ㰀氀椀 挀氀愀猀猀㴀∀琀椀琀氀攀∀㸀㰀栀㈀㸀㄀Ā爰攀䄀猀礀渀挀䌀栀椀氀搀一漀搀攀猀 뤀핥쵬層຋㱦⼀栀㈀㸀ഀ
				<ul class="list">਍ऀऀऀऀ㰀氀椀 挀氀愀猀猀㴀∀栀椀最栀氀椀最栀琀开爀攀搀∀㸀缀⡏⁵稀吀爀攀攀伀戀樀⸀爀攀䄀猀礀渀挀䌀栀椀氀搀一漀搀攀猀 뤀핥౬욋슋셓₉䄀倀䤀 蜀捥⵨葎獶蕑륑㱛⼀氀椀㸀ഀ
				<li><p>此 Demo 只能同时选中一个父节点<br/>਍ऀऀऀऀऀ픀햋஋᩷寿 㰀愀 椀搀㴀∀爀攀昀爀攀猀栀一漀搀攀∀ 栀爀攀昀㴀∀⌀∀ 漀渀挀氀椀挀欀㴀∀爀攀琀甀爀渀 昀愀氀猀攀㬀∀㸀촀낑ꁥ絒㲏⼀愀㸀 崀☀渀戀猀瀀㬀☀渀戀猀瀀㬀☀渀戀猀瀀㬀☀渀戀猀瀀㬀嬀 㰀愀 椀搀㴀∀愀搀搀一漀搀攀∀ 栀爀攀昀㴀∀⌀∀ 漀渀挀氀椀挀欀㴀∀爀攀琀甀爀渀 昀愀氀猀攀㬀∀㸀ﴀꂏ㱒⼀愀㸀 崀㰀⼀瀀㸀ഀ
				</li>਍ऀऀऀऀ㰀氀椀㸀㰀瀀㸀㰀猀瀀愀渀 挀氀愀猀猀㴀∀栀椀最栀氀椀最栀琀开爀攀搀∀㸀ᰀ萠葠だᵗ촠層ﵓ袀璉⁛頀뙓Ų⁠萀㙶色릂㱰⼀猀瀀愀渀㸀㰀戀爀⼀㸀ഀ
					试试看：[ <a id="refreshNodeSilent" href="#" onclick="return false;">悄悄地 重新加载</a> ]&nbsp;&nbsp;&nbsp;&nbsp;[ <a id="addNodeSilent" href="#" onclick="return false;">悄悄地 追加</a> ]<br/>਍ऀऀऀऀऀ愀猀礀渀挀 氀漀最㨀㰀戀爀⼀㸀ഀ
					<ul id="log" class="log"></ul></p>਍ऀऀऀऀ㰀⼀氀椀㸀ഀ
				</ul>਍ऀऀऀ㰀⼀氀椀㸀ഀ
			<li class="title"><h2>2、setting 配置信息说明</h2>਍ऀऀऀऀ㰀甀氀 挀氀愀猀猀㴀∀氀椀猀琀∀㸀ഀ
				<li class="highlight_red">使用 zTree 提供的 reAsyncChildNodes 方法也必须设置 setting.async 中的各个属性，详细请参见 API 文档中的相关内容</li>਍ऀऀऀऀ㰀⼀甀氀㸀ഀ
			</li>਍ऀऀऀ㰀氀椀 挀氀愀猀猀㴀∀琀椀琀氀攀∀㸀㰀栀㈀㸀㌀Ā琰爀攀攀一漀搀攀 舀릂灰湥຋㱦⼀栀㈀㸀ഀ
				<ul class="list">਍ऀऀऀऀ㰀氀椀㸀ఀ⁔∀Ȁ敟ꁫ絒₏舀릂灰湥≣ ⴀ葎຋㱦⼀氀椀㸀ഀ
				</ul>਍ऀऀऀ㰀⼀氀椀㸀ഀ
			<li class="title"><h2>4、其他说明</h2>਍ऀऀऀऀ㰀甀氀 挀氀愀猀猀㴀∀氀椀猀琀∀㸀ഀ
				<li>同 "异步加载 节点数据" 中的说明</li>਍ऀऀऀऀ㰀⼀甀氀㸀ഀ
			</li>਍ऀऀ㰀⼀甀氀㸀ഀ
	</div>਍㰀⼀搀椀瘀㸀ഀ
</BODY>਍㰀⼀䠀吀䴀䰀㸀